const router = require('koa-router')(),
      indexController = require('../controllers/Index'),
      loginCheck = require('../middlewares/loginCheck');

router.get('/', indexController.index);
//获取所有课程信息
router.get('/get_courses', loginCheck, indexController.getCourses);
//获取推荐课程数据
router.get('/get_recom_course', loginCheck, indexController.getRecomCourse);
//获取轮播图数据
router.get('/get_sliders', loginCheck, indexController.getSliders);
//获取'课程集合管理'的数据
router.get('/get_collections', loginCheck, indexController.getCollections)
//获取老师信息
router.get('/get_teachers', loginCheck, indexController.getTeachers);
//获取学生信息
router.get('/get_students', loginCheck, indexController.getStudents)


//改变课程分类
router.post('/change_course_field', loginCheck, indexController.changeCourseField);
//改变所有东西的上下架状态
router.post('/change_status', loginCheck, indexController.changeDataStatus);
//选择是否为明星老师
router.post('/select_star_teacher', loginCheck, indexController.changeTeacherStar);


module.exports = router;